package com.hz.module.system.dal.mysql.check.content;

import java.util.*;

import com.hz.framework.common.pojo.PageResult;
import com.hz.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.hz.framework.mybatis.core.mapper.BaseMapperX;
import com.hz.module.system.dal.dataobject.check.content.CheckContentDO;
import org.apache.ibatis.annotations.Mapper;
import com.hz.module.system.controller.admin.check.content.vo.*;

/**
 * 检查内容清单 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface CheckContentMapper extends BaseMapperX<CheckContentDO> {

    default PageResult<CheckContentDO> selectPage(CheckContentPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<CheckContentDO>()
                .eqIfPresent(CheckContentDO::getCheckItemId, reqVO.getCheckItemId())
                .eqIfPresent(CheckContentDO::getCheckContentDetail, reqVO.getCheckContentDetail())
                .eqIfPresent(CheckContentDO::getCheckMethod, reqVO.getCheckMethod())
                .eqIfPresent(CheckContentDO::getIllegalBasis, reqVO.getIllegalBasis())
                .eqIfPresent(CheckContentDO::getPunishBasis, reqVO.getPunishBasis())
                .eqIfPresent(CheckContentDO::getSequence, reqVO.getSequence())
                .eqIfPresent(CheckContentDO::getState, reqVO.getState())
                .eqIfPresent(CheckContentDO::getLicenceFlag, reqVO.getLicenceFlag())
                .eqIfPresent(CheckContentDO::getQualifiedYesContent, reqVO.getQualifiedYesContent())
                .eqIfPresent(CheckContentDO::getQualifiedNoContent, reqVO.getQualifiedNoContent())
                .betweenIfPresent(CheckContentDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(CheckContentDO::getId));
    }

}